package com.wyt.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wyt.pojo.User;
import com.wyt.service.UserService;
import com.wyt.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author 16970
* @description 针对表【user】的数据库操作Service实现
* @createDate 2022-09-08 09:58:21
*/
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User>
    implements UserService{
    @Autowired
    private UserMapper userMapper;
    @Override
    public User getUser(String ID, String password) {
        return userMapper.getUser(ID,password);
    }

    @Override
    public List<User> selectByPage(Integer page, Integer limits, String id, String name, String publisher) {
        page= (page-1)*limits;
        return userMapper.selectByPage(page,limits,id,name,publisher);
    }

    @Override
    public int addUser(String id, String name, Integer limit, String password) {
        return userMapper.addUser(id, name, limit, password);
    }

    @Override
    public User getUserById(String id) {
        return userMapper.getUserById(id);
    }


}




